/*
 * 1.0.cpp
 *
 *  Created on: 2012-5-18
 *      Author: ncrd
 */




#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>

using namespace std;

#define LEN 101

int swapCharacter(char *a, char *b) {
	*b = *a + *b - (*a = *b);
	return 0;
}

int reverseString(char *str) {
	int len = strlen(str);
	int i;
	for (i=0; i<len/2; i++) {
		swapCharacter(&str[i], &str[len-i-1]);
	}
	return 0;
}

int main (void) {
	while (true) {
		char str[LEN];
		cin >> str;
		if (str[0] == '0' && str[1] == '\0') break;
		reverseString(str);
		cout << str << endl;
	}
	return 0;
}
